<?php

function getCategory($catData, $prentsID= 0) {
    $catList = "<ul>";
    foreach ($catData as $aCat) {
        if ($aCat['specs_parent'] == $prentsID) {
            $catList .= "<li>" . $aCat['specs_name'] . "</li>";
            $catList .= getCategory($catData, $aCat['specs_id']);
        }
    }
    $catList .= "</ul>";
    return $catList;
}
?>

